export const btnContract = [
  // 买家，生成采购合同
  {
    name: "生成合同",
    clickEvent: "createPurchaseContract",
    flag: "createPurchaseContract"
  },
  // 买家，订单上传合同
  {
    name: "订单上传合同",
    clickEvent: "uploadPurchaseDoubleSignContract",
    flag: "uploadPurchaseDoubleSignContract"
  },
  // 卖家，生成销售合同
  {
    name: "生成合同",
    clickEvent: "createSalesContract",
    flag: "createSalesContract"
  },
  // 卖家，订单上传合同
  {
    name: "订单上传合同",
    clickEvent: "uploadSalesDoubleSignContract",
    flag: "uploadSalesDoubleSignContract"
  },
  // 卖家，查看合同详情
  {
    name: "查看合同",
    clickEvent: "sellerViewContractDetail",
    flag: "sellerViewContractDetail"
  },
  // 买家，查看合同详情
  {
    name: "查看合同",
    clickEvent: "buyerViewContractDetail",
    flag: "buyerViewContractDetail"
  }
];

export const contract = {
  methods: {
    // 买家，生成采购合同
    createPurchaseContract(row) {
      this.$router.push({
        name: "buyerContractGenerate",
        query: { orderId: row.id }
      });
    },
    // 买家，订单上传采购合同
    uploadPurchaseDoubleSignContract(row) {
      this.$router.push({
        name: "buyerOrderUploadingContract",
        query: { orderId: row.id }
      });
    },
    // 卖家，生成销售合同
    createSalesContract(row) {
      this.$router.push({
        name: "sellerContractGenerate",
        query: { orderId: row.id }
      });
    },
    // 卖家，订单上传销售合同
    uploadSalesDoubleSignContract(row) {
      this.$router.push({
        name: "sellerOrderUploadingContract",
        query: { orderId: row.id }
      });
    },
    // 卖家查看合同
    sellerViewContractDetail(row) {
      this.$router.push({
        name: "sellerContractDetail",
        query: { contractId: row.contractId }
      });
    },
    // 买家查看合同
    buyerViewContractDetail(row) {
      this.$router.push({
        name: "buyerContractDetail",
        query: { contractId: row.contractId }
      });
    }
  }
};
